package com.epoint.mobileoa.personalized.epointcompany.ui.kaoqing;

import java.util.ArrayList;
import java.util.List;

import com.epoint.mobileoa.bizlogic.SuperView;

import android.graphics.Color;
import android.text.Html;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class RecardsAdapter extends BaseAdapter {
	private List<KaoQingInfo> data = new ArrayList<KaoQingInfo>();
	private SuperView mContext;

	public RecardsAdapter(SuperView ctxt) {

		mContext = ctxt;
	}

	public void setList(List<KaoQingInfo> list) {
		data = list;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return data.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return data.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		TextView recard = new TextView(mContext);
		KaoQingInfo info = data.get(position);
		recard.setText(Html.fromHtml("<font color="+mContext.getBlackOrWhiteColor()+"> 时间：" + info.time + "</font> <br/> <font color ="+mContext.getYGColor()+">地点：" + info.address+"</font"));
		recard.setTextColor(Color.rgb(255, 201, 14));
		recard.setTextSize(14);
		return recard;
	}

}
